#ifndef __M_CONSUMER_H__
#define __M_CONSUMER_H__

#include "../mqcommon/mq_helper.hpp"
#include "../mqcommon/mq_logger.hpp"
#include "../mqcommon/mq_msg.pb.h"
#include <iostream>
#include <unordered_map>
#include <memory>
#include <vector>
#include <string>
#include <mutex>
#include <functional>

namespace wsmq
{
    using ConsumerCallback = std::function<void(const std::string&, const BasicProperties *, const std::string&)>;

    struct Consumer
    {
        using ptr = std::shared_ptr<Consumer>;
        std::string _tag;
        std::string _qname;
        bool _auto_ack;
        ConsumerCallback _callback;
        Consumer() 
        {
            DLOG("new a consumer: %p", this);
        }
        Consumer(const std::string &tag, const std::string &qname, bool auto_ack, ConsumerCallback callback) 
        : _tag(tag), _qname(qname), _auto_ack(auto_ack), _callback(callback)
        {
            DLOG("new a consumer: %p", this);
        }
        ~Consumer() 
        {
            DLOG("delete a consumer: %p", this);
        }
    };
    
}

#endif